'''nba = ["迈克尔乔丹","比尔拉塞尔","贾巴尔","张伯伦","约翰逊","科比","邓肯","詹姆斯"]
print(nba[1:5])
print(nba[0:5:2])'''
#添加元素
'''m=[1,2,3,4,5]
m.insert(2,7)
print(m)'''

#排序
'''grade=[100,90,87,76,98]
print("源列表",grade)
grade.sort()
print("升   序",grade)
grade.sort(reverse=True)
print("降   序",grade)

char=["Angela","Tom","cat","pet"]
char.sort()
print("区分字母大小写",char)
char.sort(key=str.lower)
print("不区分字母大小写:",char)'''

#for循环 enumerate()函数实现
'''print("2017~2018赛季NBA西部联盟前八名\n")
team = ["火箭","勇士","开拓者","雷霆","爵士","鹈鹕","马刺","森林狼"]
for index,item in enumerate(team):
    print("第",index+1,"名:",item)'''

#随机生成10个0-100的数字
'''from random import *
a = []
for i in range(10):
    a.append(randint(0,100))
for j in range(10):
    print(a[j],end='')
    print()
    print(min(a))
    a.sort()
    print(a)
    a.reverse()
    print(a)

from random import *
a = [randint]
    print(a)
    print(min(a))
    a.sort()
    print(a)
    a.reverse()
    print(a)'''

'''price =[1200,5330,2988,6200,1998,8888]
sale = [int(x*0.5) for x in price]
print("原价格:",price)
print("打五折的价格:",sale)'''

'''price =[1200,5330,2988,6200,1998,8888]
 sale = [x for x in price if x>5000]
 print("原价格:",price)
 print("价格高于5000的:",sale)'''

'''python = set(['绮梦','冷伊一','香凝','梓轩'])
c = set(['冷伊一','零语','梓轩','圣博'])
print('选择Python语言的学生有:',python)
print('选择C语言的学生有:',c)
print('交集运算:',python & c)
print('并集运算:',python | c)
print('差集运算:',python - c)'''

'''set1 = set(['绮梦','冷伊一','香凝','黛兰'])
set1.add('貂蝉')
print(set1)
set1.remove('绮梦')
print(set1)
set1.pop()
print(set1)
set1.clear()
print(set1)'''

'''name = ['绮梦','冷伊一','香凝','黛兰']
sign = ['水瓶座','射手座','双鱼座','双子座']
dictionary = dict(zip(name,sign))
print(dictionary)'''


'''def function_tips():
    #功能: 每天输出一条励志文字
    
    import datatime   #导入日期时间类
    #定义一个列表
    mot = ["坚持下去不是因为我很坚强，而是因为我别无选择",
    "含泪播种的人一定能笑着收获",
    "作对的事情比把事情做对更重要",
    "命运给予我们的不是失望之酒，而是机会之杯"]
    day = datatime.datetime.now().weekday()
    print(mot[day])
function_tips()'''

#定义函数
'''def demo(obj):
    print("形参值:",obj)
    obj +=obj
    print("形参值:",obj)
#调用函数
print("==========值传递==========")
string = "这是第一个测试"
print("调用函数前实参值:",string)
demo(string)
print("调用函数后实参值:",string)
print("===========引用传递==========")
list1 = ['1','2','3','4']
print("调用函数前实参值:",list1)
demo(list1)
print("调用函数后实参值:",list1)
'''

'''def fun_bmi(person,height,weight):
    # 功能:根据身高和体重计算BMI指数
    # person:姓名
    # height:身高，单位:米
    # weight:体重，单位:千克
    print(person + "的身高：" + str(height) +"米\t 体重：" + str(weight) + "千克")
    bmi = weight/(height*height)
    print(person + "的BMI指数为:" + str(bmi))
    #判断身材是否合理
    if bmi < 18.5:
        print("您的体重过轻\n")
    if bmi >= 18.5 and bmi < 24.9:
        print("正常范围，注意保持\n")
    if bmi >= 24.9 and bmi < 29.9:
        print("您的体重过重\n")
    if bmi >= 29.9:
        print("肥胖\n")
    
fun_bmi("路人甲",1.83,60)
fun_bmi("胡轩然",1.73,70)'''

'''def  demo(obj=[]):
    if obj == None:
        obj = []
    print("obj的值",obj)
    obj.qppend(1)
    
demo()
demo()
demo()'''

'''def g(e):
    print(e)
g('Hello') #java中的重载
 

def g(*args):
    for i in args:
        print(i,end="")
    print()
g(1,26,8465,49512,4984,54684,168489)

def test(**kwargs):
    print(kwargs)'''

'''def y(a,b,c,d):
    print(a,b,c,d)

r = (1,2,3,4)
y(*r)'''

# def F(a,b = 20,*x,**y):
#     s = a + b
#     for i in x:
#         s += i
#     for i in y.values():
#         s += i
#     return s
# Sum = F(2,10,1,2,3,4,c = 10,d = 20)
# print(Sum)

# def fun_checkout(money):
#     '''功能:计算商品合计金额并进行折扣处理
#        money:保存商品金额的列表
#        返回商品合计金额和折扣后的金额
#     '''
#     money_old = sum(money)
#     money_new = money_old
#     if 500 <=money_old < 1000:
#         money_new = '{:.2f}'.format(money_old * 0.9)
#     elif 1000 <= money_old <= 2000:
#         money_new = '{:.2f}'.format(money_old * 0.8)
#     elif 2000 <= money_old <= 3000:
#         money_new = '{:.2f}'.format(money_old * 0.7)
#     elif money_old >= 3000:
#         money_new = '{:.2f}'.format(money_old * 0.6)
#     return money_old,money_new

# print("\n开始结算.......\n")
# list_money = []
# while True:
#     #请不要输入非法的金额，否则将抛出异常
#     inmoney = float(input("输入商品金额(输入0表示输入完毕):"))
#     if int(inmoney) == 0:
#         break
#     else:
#         list_money.append(inmoney)
# money = fun_checkout(list_money)
# print("合计金额:",money[0],"应付金额:",money[1])

# import math
# def circlearea(r):
#     result  = math.pi*r*r
#     return result
# r = 10
# print('半径为',r,'的圆的面积为:',circlearea(r))

# import math
# r = 10
# result = lambda r:math.pi*r*r

# bookinfo = [('不一样的卡梅拉(全套),22.50,120'),('零基础学Android',65.10,89.80),
#             ('摆渡人',23.40,36.00),]

# def division():
#     '''功能:分苹果'''
#     print("\n================分苹果了=================\n")
#     apple = int(input("请输入苹果的个数:"))
#     children = int(input("请输入来了几个小朋友:"))
#     if apple < children:
#         raise ValueError("苹果太少了,不够分...")
#     result = apple//children
#     remain = apple-result*children
#     if remain > 0:
#         print(apple,"个苹果,平均分给",children,"个小朋友,每人分",result,"个,剩下",remain,"个。")
#     else:
#         print(apple,"个苹果,平均分给",children,"个小朋友,每人分",result,"个。")
# try:
#     division()
# except ZeroDivisionError:
#     print("\n出错了苹果不能被0个小朋友分!")
# except ValueError as e:
#     print("\n输入错误:",e)
# else:
#     print("分苹果顺利完成。。。")
# finally:
#     print("进行了一次分苹果操作。")

# 模拟电影点播
# class TVshow:
#     list_film = ["战狼2","红海行动","西游记","熊出没"]
#     def_init_(self,show):
#         self._show = show
#     @property
#     def show(self,value):
#         if value in TVshow.list_flim:
#             self._show = "您选择了《"+value+"》,稍后将播放"
#         else:
#             self._show = "您点播的电影不存在"

# class Swan:
#     '''天鹅类'''
#     _neck_swan = '天鹅脖子很长'
#     def  __init__(self):
#         print('__init__():',Swan._neck_swan)
# wildswan = Swan()
# print('直接访问:',wildswan._nect_swan)

# class Swan:
#     '''天鹅类'''
#     __wing_swan = '天鹅翅膀也很长'
#     def __init__(self):
#         print('__init__():',Swan.__neck_swan)
# wildswan = Swan()
# print('加入类名:',wildswan._Swan__neck_swan)
# print('加入类名:',wildswan.__neck_swan)

# class Person:
#     def_init_(self,name):
#     self.name = name
#     self._age = 1
#     def set_age(self,new_age):
#         if 0 < new_age <= 120:
#             self._age = new_age
#     def get_age(self):
#         return self._age

# person = Person("小明")
# person.set_age(20)
# print(f"年龄为{person.get_age()}岁")

# class Cat:
#     def shout(self):
#         print("喵喵喵~")
# class Dog:
#     def shout(self):
#         print("汪汪汪!")
# def shout(obj):
#     obj.shout()
# cat = Cat()
# dog = Dog()
# shout(cat)
# shout(dog)

class Calculator(object):
    def _init_(self,number):
        self.number = number
    def _add_(self,other):
        self.number = self.number + other
        return self.number
    def _sub_(self.other):
        self.number = self.number - other
        return self.number
    def _mul_(self,other):
        self.number = self.number*other
        return self.number
    def _truediv_(self,other):
        self.number = self.number/other





















































































































































